home *** CD-ROM | disk | FTP | other *** search
/ Freelog 117 / FreelogNo117-OctobreNovembre2013.iso / Programmation / jedit / jedit5.1.0install.exe / {app} / modes / django.xml < prev    next >
Extensible Markup Language  |  2013-07-28  |  8KB  |  269 lines

  1. <?xml version="1.0"?>
  2. <!--
  3. Original author Ollie Rutherfurd
  4.  
  5. Django 1.2 templates edit mode
  6. <http://docs.djangoproject.com/en/dev/topics/templates/>
  7.  
  8. Updated 2010-09-10 by Jakub Roztocil <jakub@webkitchen.cz>
  9. * Added missing filters, tags, operators, etc.
  10. * Higlight Django syntax inside tags and attributes
  11. * Higlight CSS (and to some extent also Django tags) inside <style>
  12. * Higlight JavaScript inside <script>
  13.  
  14. CSS & JS integration and tag highlighting inspired by the PHP mode.
  15.  
  16. -->
  17. <MODE>
  18.     <PROPS>
  19.         <PROPERTY NAME="commentStart" VALUE="{% comment %}" />
  20.         <PROPERTY NAME="commentEnd" VALUE="{% endcomment %}" />
  21.     </PROPS>
  22.  
  23.     <RULES IGNORE_CASE="TRUE">
  24.         <IMPORT DELEGATE="html::MAIN"/>
  25.         <IMPORT DELEGATE="DJANGO" />
  26.  
  27.         <!-- JavaScript -->
  28.         <SPAN TYPE="MARKUP" DELEGATE="JAVASCRIPT_OPENTAG">
  29.             <BEGIN><SCRIPT</BEGIN>
  30.             <END></SCRIPT></END>
  31.         </SPAN>
  32.  
  33.         <!-- CSS -->
  34.         <SPAN TYPE="MARKUP" DELEGATE="CSS_OPENTAG">
  35.             <BEGIN><STYLE</BEGIN>
  36.             <END></STYLE></END>
  37.         </SPAN>
  38.  
  39.         <!-- TAGS -->
  40.         <SEQ_REGEXP HASH_CHAR="<" TYPE="MARKUP" DELEGATE="TAGS"></?\w+</SEQ_REGEXP>
  41.     </RULES>
  42.  
  43.     <RULES SET="DJANGO">
  44.         <SPAN TYPE="COMMENT3">
  45.             <BEGIN>{% comment %}</BEGIN>
  46.             <END>{% endcomment %}</END>
  47.         </SPAN>
  48.         <SPAN TYPE="KEYWORD3" DELEGATE="DJANGO_BLOCK">
  49.             <BEGIN>{%</BEGIN>
  50.             <END>%}</END>
  51.         </SPAN>
  52.         <SPAN TYPE="KEYWORD3" DELEGATE="DJANGO_VARIABLE">
  53.             <BEGIN>{{</BEGIN>
  54.             <END>}}</END>
  55.         </SPAN>
  56.     </RULES>
  57.  
  58.     <!-- Javascript -->
  59.     <RULES SET="JAVASCRIPT_OPENTAG" DEFAULT="MARKUP">
  60.         <SEQ TYPE="MARKUP" DELEGATE="JAVASCRIPT">></SEQ>
  61.         <IMPORT DELEGATE="TAGS"/> <!-- handle Django in <script> tag -->
  62.         <IMPORT DELEGATE="html::TAGS" /> <!-- handle e.g. 'style="width:1px"' -->
  63.     </RULES>
  64.     <RULES SET="JAVASCRIPT" DEFAULT="MARKUP" ESCAPE="\">
  65.         <IMPORT DELEGATE="TO_LITERAL+DJANGO"/>
  66.         <IMPORT DELEGATE="DJANGO"/>
  67.         <IMPORT DELEGATE="javascript::MAIN"/>
  68.     </RULES>
  69.  
  70.     <!-- CSS -->
  71.     <RULES SET="CSS_OPENTAG" DEFAULT="MARKUP">
  72.         <SEQ TYPE="MARKUP" DELEGATE="CSS">></SEQ>
  73.         <IMPORT DELEGATE="TO_LITERAL+DJANGO"/>
  74.     </RULES>
  75.     <RULES SET="CSS" DEFAULT="MARKUP">
  76.         <PROPS>
  77.             <PROPERTY NAME="lineComment" VALUE="" />
  78.         </PROPS>
  79.         <IMPORT DELEGATE="TO_LITERAL+DJANGO"/>
  80.         <IMPORT DELEGATE="DJANGO"/>
  81.         <IMPORT DELEGATE="css::MAIN"/>
  82.     </RULES>
  83.  
  84.     <!-- Inside tags and attributes -->
  85.     <RULES SET="TAGS" DEFAULT="MARKUP">
  86.         <IMPORT DELEGATE="TO_LITERAL+DJANGO" />
  87.         <IMPORT DELEGATE="html::TAGS" /><!-- handle e.g. 'style="width:1px"' -->
  88.         <SEQ TYPE="MARKUP" DELEGATE="MAIN">></SEQ>
  89.     </RULES>
  90.  
  91.     <RULES SET="TO_LITERAL+DJANGO">
  92.         <SPAN TYPE="LITERAL1" DELEGATE="LITERAL1+DJANGO">
  93.             <BEGIN>'</BEGIN>
  94.             <END>'</END>
  95.         </SPAN>
  96.         <SPAN TYPE="LITERAL1" DELEGATE="LITERAL1+DJANGO">
  97.             <BEGIN>"</BEGIN>
  98.             <END>"</END>
  99.         </SPAN>
  100.         <IMPORT DELEGATE="DJANGO"/>
  101.     </RULES>
  102.  
  103.     <!-- LITERAL1 + Django syntax (eg. attribute values) -->
  104.     <RULES SET="LITERAL1+DJANGO" DEFAULT="LITERAL1">
  105.         <IMPORT DELEGATE="DJANGO"/>
  106.     </RULES>
  107.  
  108.  
  109.  
  110.     <RULES SET="DJANGO_VARIABLE" DEFAULT="LITERAL4">
  111.         <IMPORT DELEGATE="DJANGO_CORE"/>
  112.     </RULES>
  113.  
  114.     <RULES SET="DJANGO_BLOCK" DEFAULT="LITERAL4">
  115.         <IMPORT DELEGATE="DJANGO_CORE"/>
  116.         <KEYWORDS>
  117.  
  118.             <OPERATOR>==</OPERATOR>
  119.             <OPERATOR>!=</OPERATOR>
  120.             <OPERATOR><</OPERATOR>
  121.             <OPERATOR>></OPERATOR>
  122.             <OPERATOR><=</OPERATOR>
  123.             <OPERATOR>>=</OPERATOR>
  124.  
  125.             <KEYWORD1>in</KEYWORD1>
  126.             <KEYWORD1>not</KEYWORD1>
  127.             <KEYWORD1>and</KEYWORD1>
  128.             <KEYWORD1>or</KEYWORD1>
  129.             <KEYWORD1>as</KEYWORD1>
  130.  
  131.             <!--
  132.             Tags
  133.             <http://docs.djangoproject.com/en/1.2/ref/templates/builtins/#built-in-tag-reference>
  134.             -->
  135.             <KEYWORD1>cache</KEYWORD1>
  136.             <KEYWORD1>endcache</KEYWORD1>
  137.             <KEYWORD1>autoescape</KEYWORD1>
  138.             <KEYWORD1>block</KEYWORD1>
  139.             <KEYWORD1>endblock</KEYWORD1>
  140.             <KEYWORD1>csrf_token</KEYWORD1>
  141.             <KEYWORD1>cycle</KEYWORD1>
  142.             <KEYWORD1>debug</KEYWORD1>
  143.             <KEYWORD1>extends</KEYWORD1>
  144.             <KEYWORD1>filter</KEYWORD1>
  145.             <KEYWORD1>endfilter</KEYWORD1>
  146.             <KEYWORD1>firstof</KEYWORD1>
  147.             <KEYWORD1>if</KEYWORD1>
  148.             <KEYWORD1>else</KEYWORD1>
  149.             <KEYWORD1>endif</KEYWORD1>
  150.             <KEYWORD1>for</KEYWORD1>
  151.             <KEYWORD1>endfor</KEYWORD1>
  152.             <KEYWORD1>empty</KEYWORD1>
  153.             <KEYWORD1>endifchanged</KEYWORD1>
  154.             <KEYWORD1>endifequal</KEYWORD1>
  155.             <KEYWORD1>ifnotequal</KEYWORD1>
  156.             <KEYWORD1>endifnotequal</KEYWORD1>
  157.             <KEYWORD1>include</KEYWORD1>
  158.             <KEYWORD1>load</KEYWORD1>
  159.             <KEYWORD1>now</KEYWORD1>
  160.             <KEYWORD1>regroup</KEYWORD1>
  161.             <KEYWORD1>spaceless</KEYWORD1>
  162.             <KEYWORD1>endspaceless</KEYWORD1>
  163.             <KEYWORD1>ssi</KEYWORD1>
  164.             <KEYWORD1>templatetag</KEYWORD1>
  165.             <KEYWORD1>url</KEYWORD1>
  166.             <KEYWORD1>widthratio</KEYWORD1>
  167.             <KEYWORD1>with</KEYWORD1>
  168.             <KEYWORD1>endwith</KEYWORD1>
  169.             <KEYWORD1>trans</KEYWORD1>
  170.             <KEYWORD1>blocktrans</KEYWORD1>
  171.             <KEYWORD1>endblocktrans</KEYWORD1>
  172.  
  173.         </KEYWORDS>
  174.     </RULES>
  175.  
  176.     <RULES SET="DJANGO_CORE">
  177.         <SPAN TYPE="LITERAL2">
  178.             <BEGIN>"</BEGIN>
  179.             <END>"</END>
  180.         </SPAN>
  181.         <SPAN TYPE="LITERAL2">
  182.             <BEGIN>'</BEGIN>
  183.             <END>'</END>
  184.         </SPAN>
  185.         <SEQ TYPE="OPERATOR">:</SEQ>
  186.         <SEQ TYPE="OPERATOR">,</SEQ>
  187.         <SEQ TYPE="OPERATOR">|</SEQ>
  188.         <KEYWORDS>
  189.  
  190.             <!--
  191.             {% templatetag %} arguments
  192.             <http://docs.djangoproject.com/en/1.2/ref/templates/builtins/#templatetag>
  193.             -->
  194.             <LITERAL3>Argument</LITERAL3>
  195.             <LITERAL3>openblock</LITERAL3>
  196.             <LITERAL3>closeblock</LITERAL3>
  197.             <LITERAL3>openvariable</LITERAL3>
  198.             <LITERAL3>closevariable</LITERAL3>
  199.             <LITERAL3>openbrace</LITERAL3>
  200.             <LITERAL3>closebrace</LITERAL3>
  201.             <LITERAL3>opencomment</LITERAL3>
  202.             <LITERAL3>closecomment</LITERAL3>
  203.  
  204.             <!--
  205.             Filters
  206.             http://docs.djangoproject.com/en/1.2/ref/templates/builtins/#built-in-filter-reference
  207.             -->
  208.             <FUNCTION>add</FUNCTION>
  209.             <FUNCTION>addslashes</FUNCTION>
  210.             <FUNCTION>capfirst</FUNCTION>
  211.             <FUNCTION>center</FUNCTION>
  212.             <FUNCTION>cut</FUNCTION>
  213.             <FUNCTION>date</FUNCTION>
  214.             <FUNCTION>default</FUNCTION>
  215.             <FUNCTION>default_if_none</FUNCTION>
  216.             <FUNCTION>dictsort</FUNCTION>
  217.             <FUNCTION>dictsortreversed</FUNCTION>
  218.             <FUNCTION>divisibleby</FUNCTION>
  219.             <FUNCTION>escape</FUNCTION>
  220.             <FUNCTION>escapejs</FUNCTION>
  221.             <FUNCTION>filesizeformat</FUNCTION>
  222.             <FUNCTION>first</FUNCTION>
  223.             <FUNCTION>fix_ampersands</FUNCTION>
  224.             <FUNCTION>floatformat</FUNCTION>
  225.             <FUNCTION>force_escape</FUNCTION>
  226.             <FUNCTION>get_digit</FUNCTION>
  227.             <FUNCTION>iriencode</FUNCTION>
  228.             <FUNCTION>join</FUNCTION>
  229.             <FUNCTION>last</FUNCTION>
  230.             <FUNCTION>length</FUNCTION>
  231.             <FUNCTION>length_is</FUNCTION>
  232.             <FUNCTION>linebreaks</FUNCTION>
  233.             <FUNCTION>linebreaksbr</FUNCTION>
  234.             <FUNCTION>linenumbers</FUNCTION>
  235.             <FUNCTION>ljust</FUNCTION>
  236.             <FUNCTION>lower</FUNCTION>
  237.             <FUNCTION>make_list</FUNCTION>
  238.             <FUNCTION>phone2numeric</FUNCTION>
  239.             <FUNCTION>pluralize</FUNCTION>
  240.             <FUNCTION>pprint</FUNCTION>
  241.             <FUNCTION>random</FUNCTION>
  242.             <FUNCTION>removetags</FUNCTION>
  243.             <FUNCTION>rjust</FUNCTION>
  244.             <FUNCTION>safe</FUNCTION>
  245.             <FUNCTION>safeseq</FUNCTION>
  246.             <FUNCTION>slice</FUNCTION>
  247.             <FUNCTION>slugify</FUNCTION>
  248.             <FUNCTION>stringformat</FUNCTION>
  249.             <FUNCTION>striptags</FUNCTION>
  250.             <FUNCTION>time</FUNCTION>
  251.             <FUNCTION>timesince</FUNCTION>
  252.             <FUNCTION>timeuntil</FUNCTION>
  253.             <FUNCTION>title</FUNCTION>
  254.             <FUNCTION>truncatewords</FUNCTION>
  255.             <FUNCTION>truncatewords_html</FUNCTION>
  256.             <FUNCTION>unordered_list</FUNCTION>
  257.             <FUNCTION>upper</FUNCTION>
  258.             <FUNCTION>urlencode</FUNCTION>
  259.             <FUNCTION>urlize</FUNCTION>
  260.             <FUNCTION>urlizetrunc</FUNCTION>
  261.             <FUNCTION>wordcount</FUNCTION>
  262.             <FUNCTION>wordwrap</FUNCTION>
  263.             <FUNCTION>yesno</FUNCTION>
  264.  
  265.         </KEYWORDS>
  266.     </RULES>
  267.  
  268. </MODE>
  269.